package KyleBot;

import battlecode.common.Direction;
import battlecode.common.GameActionException;
import battlecode.common.RobotController;
import battlecode.common.Upgrade;

public class BOTHeadquarters implements BOT 
{
	public void RunBot(RobotController rc) throws GameActionException
	{
		if (rc.isActive()) 
		{
			/*boolean upgraded = false;
			while (!upgraded) {
				if (rc.hasUpgrade(Upgrade.PICKAXE)) {
					upgraded = true;
				} else {
					rc.researchUpgrade(Upgrade.PICKAXE);
				}
			}
			while (!rc.isActive()) {
				rc.yield();
			}
			upgraded = false;
			while (upgraded) {
				if (rc.hasUpgrade(Upgrade.DEFUSION)) {
					upgraded = true;
				} else {
					rc.researchUpgrade(Upgrade.DEFUSION);
				}
			}
			while (!rc.isActive()) {
				rc.yield();
			}*/
			
			// Spawn a soldier
			Direction dir = rc.getLocation().directionTo(rc.senseEnemyHQLocation());
			while (true) {
				if (rc.canMove(dir) && rc.isActive())
					rc.spawn(dir);
			}
		}
	}
}
